import React, { useState } from 'react';
// import { gql, useMutation } from '@apollo/client';
import { AccountModal } from '../components/AccountModal';
// import { message } from 'antd';

// const AddAccountGql = gql`
//   mutation AddAccount($username: String!, $password: String!) {
//     addAccount(username: $username, password: $password) {
//       code
//       message
//     }
//   }
// `;

export const Page4: React.FC = () => {
  const [modalVisible, setModalVisible] = useState<boolean>(false);
  // const [addTodo, { data, loading }] = useMutation(AddAccountGql, {
  //   ignoreResults: false,
  //   onCompleted: (data) => {
  //     console.log('回调', data);
  //   }
  // });
  // if (loading) return null
  // const addAccountHandle = () => {
  //   addTodo({
  //     variables: {
  //       username: '王五',
  //       password: '123456',
  //     }
  //   })
  //   console.log(data, '创建结果');
  // };
  return (
    <div>
      <AccountModal isModalVisible={modalVisible} setIsModifyVisible={() => setModalVisible(false)} loadData={() =>{}}></AccountModal>
      <button onClick={() => setModalVisible(true)}>添加数据</button>
    </div>
  )
}